package com.neusoft.elm.po;

public class User {

	private String userId;
	private String password;
	private String userName;
	private Integer userSex;
	private String userImg;
	private Integer delTag;

	public String getUserId() {
		return userId;
	}

	public void setUserId(String userId) throws ValidationException {
		if (!(userId.matches("^1[3-9]\\d{9}$"))) {
			throw new ValidationException("手机号输入有误");
		}
		this.userId = userId;
	}

	public String getPassword() {
		return password;
	}

	public void setPassword(String password) throws ValidationException {
		if (!(password.matches("^(?=.*[a-z])(?=.*[A-Z])(?=.*\\d)(?=.*[!@#$%^&*()=_+;':,.?]).{8,}$"))) {
			throw new ValidationException("密码必须包含大小写字母，数字，特殊字符，且长度八位以上");
		}
		this.password = password;
	}

	public String getUserName() {
		return userName;
	}

	public void setUserName(String userName) {
		this.userName = userName;
	}

	public Integer getUserSex() {
		return userSex;
	}

	public void setUserSex(Integer userSex) {
		this.userSex = userSex;
	}

	public String getUserImg() {
		return userImg;
	}

	public void setUserImg(String userImg) {
		this.userImg = userImg;
	}

	public Integer getDelTag() {
		return delTag;
	}

	public void setDelTag(Integer delTag) {
		this.delTag = delTag;
	}

	public class ValidationException extends Exception {
		public ValidationException(String message) {
			super(message);
		}
	}

}